<script type="text/javascript">
//提交表单
<?php if($_GET['type']<>'content'||model('user_group')->model_power('category','visit')){ ?>
savelistform({addurl:"__URL__/add",listurl:"__APP__/category"});
<?php }else{ ?>
saveform({
	success:function(msg){
		tip({msg:msg,time:3});
	},
	failure:function(msg){
		tip({msg:msg,time:3});
	}
	});
<?php } ?>
//高级模式
function advanced(){
	$('.advanced').toggle();
}
//模板列表
function tpl_list(id){
	var list = [ 
	<!--foreach:{$tpl_list $vo}-->
	{
		href: "javascript:;\" onclick=\"tpl_val('"+id+"','{$vo}');\"",
		text: "{$vo}"
	},
	<!--{/foreach}-->
	{
		text: "请选择模板"
	}];
	return list;
	
}
//模板赋值
function tpl_val(id,val){
	$('#'+id).val(val);
	$.powerFloat.hide();
	return false;
}
//页面执行
$(document).ready(function() {
	//模板选择
	$("#class_tpl").powerFloat({
		width: 302,
		eventType: "click",
		edgeAdjust:false,
		target:tpl_list('class_tpl'),
		targetMode: "list"
	});
	$("#content_tpl").powerFloat({
		width: 302,
		eventType: "click",
		edgeAdjust:false,
		target:tpl_list('content_tpl'),
		targetMode: "list"
	});
});


</script>